<!--{include file="public/top" /}-->

<body>
<div class="x-body">
    <form class="layui-form" autocomplete="off">
        <div class="layui-form-item">
            <input type="hidden" value="<!--{$data.id}-->" name="id">
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>栏目名称
                </label>
                <div class="layui-input-block">
                    <input type="text" name="name" value="<!--{$data.name}-->" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    名称扩展
                </label>
                <div class="layui-input-block">
                    <input type="text" name="pname" value="<!--{$data.pname}-->" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>标题
                </label>
                <div class="layui-input-block">
                    <input type="text" name="title" value="<!--{$data.title}-->" lay-verify="required"
                           class="layui-input">
                </div>

            </div>
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>关键词
                </label>
                <div class="layui-input-block">
                    <input type="text" name="keyword" value="<!--{$data.keyword}-->" lay-verify="required"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>描述
                </label>
                <div class="layui-input-block">
                    <textarea style="width: 800px;height: 100px" name="description" class="layui-textarea"><!--{$data.description}--></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    <span class="x-red">*</span>列表模板
                </label>
                <div class="layui-input-block">
                    <input type="text" name="lietemp" value="<!--{$data.lietemp}-->" lay-verify="required" class="layui-input">
                </div>
            </div>
            
            <div class="layui-form-item">
                <label  class="layui-form-label">
                    内容模板
                </label>
                <div class="layui-input-block">
                    <input type="text"  name="neitemp" value="<!--{$data.neitemp}-->" class="layui-input">
                </div>
            </div>
        </div>
        <div>
            <span class="x-red">*</span>栏目内容
            <script type="text/plain" id="editor" class="ueueueue"><!--{$data.content|raw}--></script>
            <div class="con-split" style="height: 80px;"></div>
        </div>
        <br>
        <div class="layui-form-item">
            <button type="button"  class="layui-btn layui-btn-normal" lay-filter="up" lay-submit="">提交</button>
        </div>
    </form>
</div>
<script>
    var upurl = '/admin/newslanmu/edit';
    var ue = UE.getEditor('editor');
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;


        //监听提交
        form.on('submit(up)', function(data){
            $.post(upurl, data.field,function(res) {
                if(res.code===200){
                    layer.msg(res.msg, {
                        time: 1000, //不自动关闭
                        icon:6,
                        end:function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        }
                    });
                    return false;
                }else {
                    layer.msg(res.msg)
                }
            });
        });
    });
</script>

</body>

</html>